/**
 * 
 */
package com.yidu.drug.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yidu.drug.dao.FdPoBreakdownModelMapper;
import com.yidu.drug.model.FdPoBreakdownModel;
import com.yidu.drug.service.FdPoBreakdownModelService;

/**
 * 类的描述    
 * @author xiaodozi
 * @date 2018年8月13日 上午10:37:26 
 * @version 1.0
 */
@Service
public class FdPoBreakdownModelServiceImpl implements FdPoBreakdownModelService{

	@Resource
	private FdPoBreakdownModelMapper fdPoBreakdownModelMapperDao;
	
	/**
	 * 根据订单表id查看采购的数据
	 */
	@Override
	public List<FdPoBreakdownModel> findByfdPoId(FdPoBreakdownModel fdPoBreakdownModel,int page,int limit) {
		List<FdPoBreakdownModel> list=fdPoBreakdownModelMapperDao.findByfdPoId(fdPoBreakdownModel,page,limit);
		return list;
	}

	/**
	 * 增加药品
	 */
	@Override
	public int save(FdPoBreakdownModel fdPoBreakdownModel) {

		return fdPoBreakdownModelMapperDao.insertSelective(fdPoBreakdownModel);
	}

	/**
	 * 删除
	 */
	@Override
	public int delete(String fdPodId) {
		
		return fdPoBreakdownModelMapperDao.deleteByPrimaryKey(fdPodId);
	}
	/**
	 * 根据订单表的id删除详情表的所有数据
	 */
	@Override
	public int deletes(String fdPoId) {
		
		return fdPoBreakdownModelMapperDao.deletes(fdPoId);
	}

	/**
	 * 
	 * 根据id修改数据
	 */
	@Override
	public Object update(Integer fdItemNumber, String fdItemRemark, Integer fdSubtotal, String fdPodId) {
		
		return fdPoBreakdownModelMapperDao.update(fdItemNumber, fdItemRemark, fdSubtotal, fdPodId);
	}

	/**
	 * 查询
	 */
	@Override
	public Integer findRows(FdPoBreakdownModel fdPoBreakdownModel) {
		int row=fdPoBreakdownModelMapperDao.findRows(fdPoBreakdownModel);
		return row;
	}

	/**
	 * 根据订单id查询数量和价格
	 */
	@Override
	public Integer findAllsl(String fdPoId) {
		return fdPoBreakdownModelMapperDao.findAllsl(fdPoId);
	}
	/**
	 * 根据订单id查询价格
	 */
	@Override
	public Integer findAlljg(String fdPoId) {
		return fdPoBreakdownModelMapperDao.findAlljg(fdPoId);
	}

	@Override
	public int findTotalRows(FdPoBreakdownModel fdPoBreakdown) {
		// TODO Auto-generated method stub
		return fdPoBreakdownModelMapperDao.findTotalRows(fdPoBreakdown);
	}

	@Override
	public List<FdPoBreakdownModel> findAllPage(Map<String, String> paramMap) {
		// TODO Auto-generated method stub
		return fdPoBreakdownModelMapperDao.findAllPage(paramMap);
	}
}
